<?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2016/4/23
 * Time: 21:56
 */

$url ="http://114.215.209.229/index.php";
function concat(array $param)
{
    ksort($param);
    $first = '';
    foreach ($param as $key => $val) {
        if(is_array($val)) {
            $first .= concat($val);
            continue;
        }

        if(!empty($val)) {
            $first .= $val;
        }
    }
    return $first;
}
function post_curl($url,$post_data){
    $ch = curl_init ();
    // print_r($ch);
    curl_setopt ( $ch, CURLOPT_URL, $url );
    curl_setopt ( $ch, CURLOPT_POST, 1 );
    curl_setopt ( $ch, CURLOPT_HEADER, 0 );
    curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );
    curl_setopt ( $ch, CURLOPT_POSTFIELDS, $post_data );
    $return = curl_exec ( $ch );
    curl_close ( $ch );
    return $return;
}
$param = array();
$param['apiCode'] = "_ali_pay_001";
$param['invest_id'] = "205";
$param['userToken'] = "86b427f571d452f17272b356061a1db2";
$sign = concat($param)."1e56c95504a9a846e4c7043704a20f25";
$param['token'] = md5($sign);
$post_data['json'] = json_encode($param);
$res = post_curl($url,$post_data);
print_r($res);
